<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta name="Content-Type" content="text/html; charset=UTF-8" />
<title>Class: Reflection::Directory::Base</title>
<link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  relpath = '../..';
  if (relpath != '') relpath += '/';
</script>
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>

  </head>
  <body>
    <div id="header">
      <div id="menu">
  
    <a href="../../_index.html">Index (B)</a> &raquo; 
    <a title="Reflection" href="../../Reflection.html">Reflection</a> &raquo; <a title="Directory" href="../Directory.html">Directory</a>
     &raquo; 
    <span class="title">Base</span>
  
</div>

      <div id="search">
  <a id="class_list_link" href="#">Namespace List</a>
  <a id="method_list_link" href="#">Method List</a>
  <a id ="file_list_link" href="#">File List</a>
</div>

      <div class="clear"></div>
    </div>
    
    <iframe id="search_frame"></iframe>
    
    <div id="content"><h1>Class: Reflection::Directory::Base 
  
  
</h1>

<dl class="box">
  
    <dt class="r1">Inherits:</dt>
    <dd class="r1">
      <span class="inheritName">Object</span>
      
      </dd>
    
  
  
    
  
    
  
  
    <dt class="r2 last">Defined in:</dt>
    <dd class="r2 last">lib/reflection/directory/base.rb</dd>
  
</dl>
<div class="clear"></div>



  <h2>Attribute Summary</h2>
  <ul class="summary">
    
      <li class="public ">
  <span class="summary_signature"><a title="#path (instance method)" href="#path-instance_method">- (Object) <strong>path</strong> </a>
  
  </span>
  
    
    
  
  
  
  

  
    <span class="summary_desc">
Returns the value of attribute <tt>path</tt>.

</span>
  
</li>

    
  </ul>


  <h2>Method Summary</h2>
  <ul class="summary">
    
      <li class="public ">
  <span class="summary_signature"><a title="#clean! (instance method)" href="#clean%21-instance_method">- (Object) <strong>clean!</strong> </a>
  
  </span>
  
  
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature"><a title="#copy_git_index_to (instance method)" href="#copy_git_index_to-instance_method">- (Object) <strong>copy_git_index_to</strong>(target_path) </a>
  
  </span>
  
  
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature"><a title="#exists? (instance method)" href="#exists%3F-instance_method">- (Object) <strong>exists?</strong> </a>
  
  </span>
  
  
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature"><a title="#get_git_index_from (instance method)" href="#get_git_index_from-instance_method">- (Object) <strong>get_git_index_from</strong>(target_path) </a>
  
  </span>
  
  
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature"><a title="#git_index (instance method)" href="#git_index-instance_method">- (Object) <strong>git_index</strong> </a>
  
  </span>
  
  
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature"><a title="#initialize (instance method)" href="#initialize-instance_method">- (Base) <strong>initialize</strong>(new_path) </a>
  
  </span>
  
  
  
  

  
    <span class="summary_desc">
A new instance of <tt>Base</tt>.

</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature"><a title="#move_content_to (instance method)" href="#move_content_to-instance_method">- (Object) <strong>move_content_to</strong>(target_path) </a>
  
  </span>
  
  
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature"><a title="#name (instance method)" href="#name-instance_method">- (Object) <strong>name</strong> </a>
  
  </span>
  
  
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature"><a title="#parent (instance method)" href="#parent-instance_method">- (Object) <strong>parent</strong> </a>
  
  </span>
  
  
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature"><a title="#to_s (instance method)" href="#to_s-instance_method">- (Object) <strong>to_s</strong> </a>
  
  </span>
  
  
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
  </ul>

<div id="constructor_details">
  <h2>Constructor Details</h2>
  
    <div class="method_details first">
  <p class="signature first" id="initialize-instance_method">
  
    - (<tt><a title="Base" href="">Base</a></tt>) <strong>initialize</strong>(new_path) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
A new instance of <tt>Base</tt>
</p>


  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a title="Base" href="">Base</a></tt>)</span>
      
      
      
      
        &mdash;
        
a new instance of <tt>Base</tt>


      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


9
10
11</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/reflection/directory/base.rb', line 9</span>

<span class='def def kw'>def</span> <span class='initialize identifier id'>initialize</span><span class='lparen token'>(</span><span class='new_path identifier id'>new_path</span><span class='rparen token'>)</span>
  <span class='self self kw'>self</span><span class='dot token'>.</span><span class='path identifier id'>path</span> <span class='assign token'>=</span> <span class='new_path identifier id'>new_path</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
  
</div>

  <div id="attr_details">
    <h2>Attribute Details</h2>
    
      
      <span id="path=-instance_method"></span>
      <span id="path-instance_method"></span>
      <div class="method_details first">
  <p class="signature first" id="path-instance_method">
  
    - (<tt>Object</tt>) <strong>path</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
Returns the value of attribute <tt>path</tt>
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


7
8
9</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/reflection/directory/base.rb', line 7</span>

<span class='def def kw'>def</span> <span class='path identifier id'>path</span>
  <span class='@path ivar id'>@path</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>


  <div id="method_details">
    <h2>Method Details</h2>
    
      <div class="method_details first">
  <p class="signature first" id="clean!-instance_method">
  
    - (<tt>Object</tt>) <strong>clean!</strong> 
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


21
22
23
24</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/reflection/directory/base.rb', line 21</span>

<span class='def def kw'>def</span> <span class='clean! fid id'>clean!</span>
  <span class='Reflection constant id'>Reflection</span><span class='dot token'>.</span><span class='log identifier id'>log</span><span class='dot token'>.</span><span class='debug identifier id'>debug</span> <span class='dstring node'>&quot;Cleaning #{self.path}/..&quot;</span>
  <span class='dxstring node'>%x(rm -r #{self.path}/*)</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="copy_git_index_to-instance_method">
  
    - (<tt>Object</tt>) <strong>copy_git_index_to</strong>(target_path) 
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


38
39
40
41</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/reflection/directory/base.rb', line 38</span>

<span class='def def kw'>def</span> <span class='copy_git_index_to identifier id'>copy_git_index_to</span><span class='lparen token'>(</span><span class='target_path identifier id'>target_path</span><span class='rparen token'>)</span>
  <span class='Reflection constant id'>Reflection</span><span class='dot token'>.</span><span class='log identifier id'>log</span><span class='dot token'>.</span><span class='debug identifier id'>debug</span> <span class='dstring node'>&quot;Copying git-index '#{self.git_index}' to #{target_path}&quot;</span>
  <span class='FileUtils constant id'>FileUtils</span><span class='dot token'>.</span><span class='cp_r identifier id'>cp_r</span><span class='lparen token'>(</span><span class='self self kw'>self</span><span class='dot token'>.</span><span class='git_index identifier id'>git_index</span><span class='comma token'>,</span> <span class='target_path identifier id'>target_path</span><span class='rparen token'>)</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="exists?-instance_method">
  
    - (<tt>Object</tt>) <strong>exists?</strong> 
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


17
18
19</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/reflection/directory/base.rb', line 17</span>

<span class='def def kw'>def</span> <span class='exists? fid id'>exists?</span>
  <span class='File constant id'>File</span><span class='dot token'>.</span><span class='exist? fid id'>exist?</span><span class='lparen token'>(</span><span class='self self kw'>self</span><span class='dot token'>.</span><span class='path identifier id'>path</span><span class='rparen token'>)</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="get_git_index_from-instance_method">
  
    - (<tt>Object</tt>) <strong>get_git_index_from</strong>(target_path) 
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


43
44
45
46
47
48
49</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/reflection/directory/base.rb', line 43</span>

<span class='def def kw'>def</span> <span class='get_git_index_from identifier id'>get_git_index_from</span><span class='lparen token'>(</span><span class='target_path identifier id'>target_path</span><span class='rparen token'>)</span>
  <span class='Reflection constant id'>Reflection</span><span class='dot token'>.</span><span class='log identifier id'>log</span><span class='dot token'>.</span><span class='debug identifier id'>debug</span> <span class='dstring node'>&quot;Getting git-index from #{target_path}&quot;</span>
  
  <span class='dxstring node'>%x(rm -rf #{self.git_index})</span> <span class='if if_mod kw'>if</span> <span class='File constant id'>File</span><span class='dot token'>.</span><span class='exists? fid id'>exists?</span><span class='lparen token'>(</span><span class='self self kw'>self</span><span class='dot token'>.</span><span class='git_index identifier id'>git_index</span><span class='rparen token'>)</span>
  <span class='dxstring node'>%x(mkdir -p #{self.path})</span>
  <span class='dxstring node'>%x(mv -f #{File.join(target_path, '/.git')} #{File.join(self.path, &quot;/&quot;)})</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="git_index-instance_method">
  
    - (<tt>Object</tt>) <strong>git_index</strong> 
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


34
35
36</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/reflection/directory/base.rb', line 34</span>

<span class='def def kw'>def</span> <span class='git_index identifier id'>git_index</span>
  <span class='File constant id'>File</span><span class='dot token'>.</span><span class='expand_path identifier id'>expand_path</span><span class='lparen token'>(</span><span class='File constant id'>File</span><span class='dot token'>.</span><span class='join identifier id'>join</span><span class='lparen token'>(</span><span class='self self kw'>self</span><span class='dot token'>.</span><span class='path identifier id'>path</span><span class='comma token'>,</span> <span class='string val'>'.git'</span><span class='rparen token'>)</span><span class='rparen token'>)</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="move_content_to-instance_method">
  
    - (<tt>Object</tt>) <strong>move_content_to</strong>(target_path) 
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


51
52
53
54
55</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/reflection/directory/base.rb', line 51</span>

<span class='def def kw'>def</span> <span class='move_content_to identifier id'>move_content_to</span><span class='lparen token'>(</span><span class='target_path identifier id'>target_path</span><span class='rparen token'>)</span>
  <span class='Reflection constant id'>Reflection</span><span class='dot token'>.</span><span class='log identifier id'>log</span><span class='dot token'>.</span><span class='debug identifier id'>debug</span> <span class='dstring node'>&quot;Moving content to '#{target_path}'..&quot;</span>
  <span class='FileUtils constant id'>FileUtils</span><span class='dot token'>.</span><span class='cp_r identifier id'>cp_r</span><span class='lparen token'>(</span><span class='File constant id'>File</span><span class='dot token'>.</span><span class='join identifier id'>join</span><span class='lparen token'>(</span><span class='self self kw'>self</span><span class='dot token'>.</span><span class='path identifier id'>path</span><span class='comma token'>,</span> <span class='string val'>'/.'</span><span class='rparen token'>)</span><span class='comma token'>,</span> <span class='target_path identifier id'>target_path</span><span class='rparen token'>)</span>
  <span class='FileUtils constant id'>FileUtils</span><span class='dot token'>.</span><span class='rm_r identifier id'>rm_r</span><span class='lparen token'>(</span><span class='File constant id'>File</span><span class='dot token'>.</span><span class='join identifier id'>join</span><span class='lparen token'>(</span><span class='self self kw'>self</span><span class='dot token'>.</span><span class='path identifier id'>path</span><span class='comma token'>,</span> <span class='string val'>'/'</span><span class='rparen token'>)</span><span class='rparen token'>)</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="name-instance_method">
  
    - (<tt>Object</tt>) <strong>name</strong> 
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


30
31
32</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/reflection/directory/base.rb', line 30</span>

<span class='def def kw'>def</span> <span class='name identifier id'>name</span>
  <span class='self self kw'>self</span><span class='dot token'>.</span><span class='path identifier id'>path</span><span class='dot token'>.</span><span class='split identifier id'>split</span><span class='lparen token'>(</span><span class='string val'>'/'</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='last identifier id'>last</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="parent-instance_method">
  
    - (<tt>Object</tt>) <strong>parent</strong> 
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


26
27
28</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/reflection/directory/base.rb', line 26</span>

<span class='def def kw'>def</span> <span class='parent identifier id'>parent</span>
  <span class='Base constant id'>Base</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='File constant id'>File</span><span class='dot token'>.</span><span class='expand_path identifier id'>expand_path</span><span class='lparen token'>(</span><span class='self self kw'>self</span><span class='dot token'>.</span><span class='path identifier id'>path</span><span class='dot token'>.</span><span class='split identifier id'>split</span><span class='lparen token'>(</span><span class='string val'>'/'</span><span class='rparen token'>)</span><span class='lbrack token'>[</span><span class='integer val'>0</span><span class='dot2 op'>..</span><span class='integer val'>-2</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='join identifier id'>join</span><span class='lparen token'>(</span><span class='string val'>'/'</span><span class='rparen token'>)</span><span class='rparen token'>)</span><span class='rparen token'>)</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="to_s-instance_method">
  
    - (<tt>Object</tt>) <strong>to_s</strong> 
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


13
14
15</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/reflection/directory/base.rb', line 13</span>

<span class='def def kw'>def</span> <span class='to_s identifier id'>to_s</span>
  <span class='self self kw'>self</span><span class='dot token'>.</span><span class='path identifier id'>path</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>
    
    <div id="footer">
  Generated on Wed Nov 18 18:17:11 2009 by 
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
  0.4.0 (ruby-1.8.7).
</div>

  </body>
</html>